package com.zhijiaoyun.dao;

import com.zhijiaoyun.dao.core.IBaseDao;
import com.zhijiaoyun.model.NewsRecommend;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface INewsRecommendDao extends IBaseDao<NewsRecommend> {

    /**
     * get by newsId
     *
     * @param newId
     * @return
     */
    NewsRecommend selectByNewsId(Long newId);

    /**
     * list all
     *
     * @return
     */
    List<NewsRecommend> selectAll();

    /**
     * list by params
     *
     * @param beginIndex
     * @param pageSize
     * @return
     */
    List<NewsRecommend> getByParamsDto(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize);

    /**
     * count by params
     *
     * @return
     */
    int countByParams();

    /**
     * page by params
     *
     * @param beginIndex
     * @param pageSize
     * @return
     */
    List<NewsRecommend> pageByParams(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize);

    /**
     * delete by newsId
     *
     * @param newsId
     */
    void deleteByNewsId(Long newsId);
}